package com.daohang361.imqq.decoder;

import com.daohang361.imqq.Asycore.QQUser;
import com.daohang361.imqq.tool.MyUtil;
/** 
 * @author naner E-mail:likun3344@163.com 
 * @create time：2011-4-16 下午07:05:35 
 *<pre>
 *88 1F 67 5F E9 00 
 *00 00 03 00 0F 01 2C 00 00 00 14 (17字节)
 *00 33 
 *E5 B0 9A E6 9C AA E5 BC 80 E9 80 9A E4 BC 9A E5 
 *91 98 EF BC 8C E7 AB 8B E5 8D B3 E7 82 B9 E5 87 
 *BB E4 BA 86 E8 A7 A3 E4 BC 9A E5 91 98 E7 89 B9 
 *E6 9D 83 [尚未开通会员，立即点击了解会员特权]
 *00 0A 
 *E7 AD 89 E7 BA A7 3A 20 31 35 [等级15]
 *00 13 
 *51 51 E6 B4 BB E8 B7 83 E5 A4 A9 E6 95 B0 3A 20 
 *33 30 30 [QQ剩余活跃天数:186]
 *00 1C 
 *E5 8D 87 E7 BA A7 E5 89 A9 E4 BD 99 E6 B4 BB E8 
 *B7 83 E5 A4 A9 E6 95 B0 3A 20 32 30 [升级剩余活跃天数:20]
 *00 1E 
 *51 51 E4 BC 9A E5 91 98 E6 88 90 E9 95 BF E9 98 
 *B6 E6 AE B5 3A 20 56 49 50 24 56 49 50 24 [QQ会员成长阶段: VIP$VIP$]
 *00 10 
 *E7 AD 89 E7 BA A7 3A 20 24 4C 45 56 45 4C 24 20[等级: $LEVEL$ ] 
 *00 31 
 *E7 AD 89 E7 BA A7 3A 20 24 4C 45 56 45 4C 24 EF 
 *BC 8C 51 51 E4 BC 9A E5 91 98 E5 8A A0 E9 80 9F 
 *E5 8D 87 E7 BA A7 51 51 E7 AD 89 E7 BA A7 E4 B8 
 *AD[等级: $LEVEL$，QQ会员加速升级QQ等级中]
 *</pre>
 */
public class Decoder5C  extends AbstractDecoder{
@Override
public QQUser decode() throws Exception {
	myArray.decryptRemain(sessionQQ.getAttr("SessionKey"));
	myArray.extract(0, 16);
	int tempLength =MyUtil.bytes2Integer(myArray.extract(0, 1));
	myArray.extract(0, tempLength-1);
	tempLength =MyUtil.bytes2Integer(myArray.extract(0, 1));
	byte[] level = myArray.extract(0, tempLength-1);//等级15
	tempLength =MyUtil.bytes2Integer(myArray.extract(0, 1));
	byte[] huoyue = myArray.extract(0, tempLength-1);//QQ剩余活跃天数
	tempLength =MyUtil.bytes2Integer(myArray.extract(0, 1));
	byte[] shengyu =myArray.extract(0, tempLength-1);//升级剩余活跃天数:20
	sessionQQ.addAttr("level", level);
	sessionQQ.addAttr("huoyue", huoyue);
	sessionQQ.addAttr("shengyu", shengyu);
System.out.println(new String(level,"UTF-8"));
System.out.println(new String(huoyue,"UTF-8"));
System.out.println(new String(shengyu,"UTF-8"));
	sessionQQ.setLogintimes(sessionQQ.getLogintimes()+1);//登陆包前进
	sessionQQ.setPakage(sessionQQ.getPakage()+1);//登陆包自动增长
	return sessionQQ;
}
}
